import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login.vue'
import AdminPage from '@/components/AdminPage.vue'
import AdminInfo from '@/components/AdminInfo.vue'
import BookType from '../components/BookType.vue'
import BookTypeVue from '../components/BookType.vue'
import UserHomepage from '@/components/UserHomepage'
import BookCity from '../components/BookCity.vue'
import MyCollection from '../components/MyCollection.vue'
import FavoriteRanking from '../components/FavoriteRanking.vue'
import MyOrder from '../components/MyOrder.vue'
import MyShping from '../components/MyShping.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
        path: "/",
        redirect: "/login"
    },
    {
        path: "/login",
        component: Login,
    },
    {
      path:"/userHomepage",
      component:UserHomepage,
      children:[
        {
            path: "/bookCity",
            component:BookCity,
        },
        {
            path: "/myCollection",
            component:MyCollection,
        },
        {
            path: "/favoriteRanking",
            component:FavoriteRanking,
        },
        {
            path: "/myOrder",
            component:MyOrder,
        },
        {
            path: "/myShping",
            component:MyShping,
        },
      ]
    },
    {
      //超级管理员
        path: "/adminPage",
        component: AdminPage,
        children:[
          {
              path: "/adminInfo",
              component: AdminInfo,
          },
          {
              path: "/bookType",
              component: BookTypeVue,
          },
        ]
    },

  ]
})
